console.log("Processing locationModel");

define(
'models/locationModel', [
  'jQuery',
  'underscore',
  'sharezApp',
],
function($, _, sharezApp, $http) {
  "use strict";


  sharezApp.factory('locationModel', function($http) {
    return {
      load: function(callback) {
        $http({
          url: "http://127.0.0.1:3000/api/locations",
          method: "GET"
        }).success(function(data, status, headers, config) {
            console.log(data);
            callback(data.locations);
        }).error(function(data, status, headers, config) {
            // TODO: Maybe we can get callback here
            //$scope.status = status;
            callback(data);
        });
      }
    }
  });
});